DormGO Server is the backend API for DormGO, which powers a mobile application that helps users save on transportation costs by connecting people traveling to the same destination. Users can coordinate and share rides by subscribing to posts, allowing them to split expenses and make travel more affordable and convenient.
This repository contains only the server-side (.NET) code.
- User authentication & registration (ASP.NET Identity, JWT)
- Manage posts through CRUD operations
- Booking/reservation management
- Real-time notifications & chat (SignalR hubs)
- Search/filter for posts
- Admin endpoints
- API documentation (Swagger)
- Email notifications
- Logging with Serilog
- .NET 8 / ASP.NET Core
- Entity Framework Core (SQL Server)
- SignalR (real-time communication)
- Serilog (logging)
- Swagger (API docs)
- Mapster (DTO mappings)
- JWT authentication
/DormGO
/Controllers # API controllers
/Models # Entity/data models
/Data # DbContext and migrations
/DTOs # Data transfer objects
/Services # Business logic & notification services
/Hubs # SignalR hubs (real-time)
/Filters # Custom filters (e.g. user email validation)
/Mappings # Mapster config for DTOs
/Constants # Auth and config constants
Program.cs # Main entry point
appsettings.json # Configuration
README.md # This file
- .NET 8 SDK
- SQL Server (or Azure SQL)
- Clone the repository:
git clone https://github.com/blendereru/DormGO.git cd DormGO
- Configure Environment:
- Copy
appsettings.json
and set your connection strings and secrets. - Optionally use environment variables for sensitive values.
- Copy
- Run the Server:
The API will start on
dotnet run
http://localhost:5093
by default.
- Edit Environment Variables:
- Replace
<your_password>
incompose.yaml
under theMSSQL_SA_PASSWORD
variable for thedb
service. - Ensure your app's connection string (in
appsettings.json
or as an environment variable) matches the database service:Server=db,1433;Database=YOUR_DB_NAME;User Id=sa;Password=YOUR_PASSWORD;
- (Optional) Set any other required secrets or configuration via your environment or override files.
- Replace
- Build and start all services:
docker compose up --build
- The API will be accessible at
http://localhost
(port 80) andhttp://localhost:8080
. - Seq logging UI will be available at
http://localhost:8081
. - SQL Server will be available at
localhost:8002
for development tools.
- The API will be accessible at
- Stopping the services:
docker compose down
- app: The DormGO backend API (.NET)
Exposes ports 80 and 8080 (adjust as needed). - db: Microsoft SQL Server 2022
Accessible on port 8002 (host) → 1433 (container).
Default user:sa
, password: set byMSSQL_SA_PASSWORD
. - seq: Seq (structured log UI for Serilog)
Accessible at http://localhost:8081.
Example connection string for the app (in appsettings.json
):
"ConnectionStrings": {
"IdentityConnection": "Server=db,1433;Database=DormGO;User Id=sa;Password=YOUR_PASSWORD;"
}
Tip:
- For production, always use strong secrets and manage them securely.
- You may use the
.env
file to inject environment variables into your containers.
- Full Swagger UI at
/swagger
- Example endpoints:
POST /api/signin
— LoginPOST /api/signup
— RegisterGET /api/posts
— List posts created by usersPOST /api/posts
— Add a post (specify price per user and maximum capacity)GET /api/posts/{id}/messages
— List all messages sent by post's members- SignalR hubs:
/api/userhub
,/api/posthub
,/api/chathub
,/api/notificationhub
Pull requests are welcome! For major changes, please open an issue first to discuss.
There's also a discussions section for questions.
- DormGO Client — Frontend for DormGO