
- Complete FastAPI application with authentication and JWT tokens - SQLite database with SQLAlchemy ORM and Alembic migrations - User management with profile features and search functionality - LinkedIn-style networking with connection requests and acceptance - Social features: posts, likes, comments, announcements, prayer requests - Event management with registration system and capacity limits - RESTful API endpoints for all features with proper authorization - Comprehensive documentation and setup instructions Key Features: - JWT-based authentication with bcrypt password hashing - User profiles with bio, position, contact information - Connection system for church member networking - Community feed with post interactions - Event creation, registration, and attendance tracking - Admin role-based permissions - Health check endpoint and API documentation Environment Variables Required: - SECRET_KEY: JWT secret key for token generation
LinkedIn-Based Church Management System
A comprehensive church management system built with FastAPI that incorporates LinkedIn-style networking features to help church members connect, share updates, and manage events.
Features
Authentication & User Management
- User registration and login with JWT tokens
- Profile management with bio, position, and contact information
- User search functionality
- Profile pictures and personal information
LinkedIn-Style Networking
- Send connection requests to other church members
- Accept/reject connection requests
- View connections and networking activity
- Professional-style member profiles
Social Features
- Create and share posts (announcements, prayer requests, general updates)
- Like and comment on posts
- Community feed with chronological posts
- Different post types (announcements, prayer requests)
Event Management
- Create and manage church events
- Event registration system with capacity limits
- Public/private event settings
- Event attendance tracking
- RSVP management
Church Member Management
- Member directory with search capabilities
- Role-based permissions (admin/member)
- Member profile management
- Contact information management
Tech Stack
- Backend: FastAPI (Python)
- Database: SQLite with SQLAlchemy ORM
- Authentication: JWT tokens with bcrypt password hashing
- Migrations: Alembic
- Validation: Pydantic
- Code Quality: Ruff for linting
Installation & Setup
-
Clone the repository
git clone <repository-url> cd linkedinbasedchurchmanagementsystem-7j9m7d
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables Create a
.env
file in the root directory with:SECRET_KEY=your-secret-key-here-change-this-in-production
-
Run database migrations
alembic upgrade head
-
Start the application
uvicorn main:app --reload
The application will be available at http://localhost:8000
API Documentation
Once the server is running, you can access:
- Swagger UI:
http://localhost:8000/docs
- ReDoc:
http://localhost:8000/redoc
- OpenAPI JSON:
http://localhost:8000/openapi.json
API Endpoints
Authentication
POST /auth/register
- Register a new userPOST /auth/token
- Login and get access tokenGET /auth/me
- Get current user information
Users
GET /users/
- Get all users (paginated)GET /users/{user_id}
- Get specific userPUT /users/me
- Update current user profileGET /users/search/{query}
- Search users
Posts
POST /posts/
- Create a new postGET /posts/
- Get all posts (paginated)GET /posts/{post_id}
- Get specific postPUT /posts/{post_id}
- Update postDELETE /posts/{post_id}
- Delete postPOST /posts/{post_id}/like
- Like a postDELETE /posts/{post_id}/like
- Unlike a postPOST /posts/{post_id}/comments
- Add comment to postGET /posts/{post_id}/comments
- Get post comments
Events
POST /events/
- Create a new eventGET /events/
- Get all eventsGET /events/{event_id}
- Get specific eventPUT /events/{event_id}
- Update eventDELETE /events/{event_id}
- Delete eventPOST /events/{event_id}/register
- Register for eventDELETE /events/{event_id}/register
- Unregister from eventGET /events/{event_id}/registrations
- Get event registrations
Connections
POST /connections/
- Send connection requestGET /connections/sent
- Get sent connection requestsGET /connections/received
- Get received connection requestsGET /connections/accepted
- Get accepted connectionsPUT /connections/{connection_id}
- Accept/reject connectionDELETE /connections/{connection_id}
- Remove connection
Environment Variables
The following environment variables need to be set:
SECRET_KEY
- JWT secret key for token generation (required)PORT
- Port number for the application (default: 8000)
Database
The application uses SQLite as the database, stored at /app/storage/db/db.sqlite
. The database schema includes:
- Users: User accounts with profiles and authentication
- Connections: LinkedIn-style connections between users
- Posts: Social media style posts with likes and comments
- Events: Church events with registration management
- Comments: Comments on posts
- Likes: Like system for posts
- Event Registrations: Event attendance tracking
Health Check
The application provides a health check endpoint at /health
that returns the service status and version information.
Development
Running with Auto-reload
uvicorn main:app --reload --host 0.0.0.0 --port 8000
Code Quality
The project uses Ruff for code formatting and linting:
ruff check .
ruff format .
Database Migrations
To create a new migration:
alembic revision --autogenerate -m "Description of changes"
To apply migrations:
alembic upgrade head
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
License
This project is licensed under the MIT License.