Open-Source API server powered by Django, a progressive Node.js framework for building efficient, reliable, and scalable server-side applications.
Status: Work in progress
- ๐ Django API Server - Complete Documentation
- ๐ Get Support via Email and Discord
- Best Practices: Follows industry-standard best practices for building robust APIs.
- Backend: Built with Django, a powerful and scalable Node.js framework.
- UI:
- React Mantis (optional frontend integration).
- Simple, modular & intuitive structure: Easy to understand and extend.
- Toolchain:
- Usable with the latest Node.js LTS versions:
- v22.x
- v21.x
- v20.x
- Package Managers:
- PNPM,
- Yarn,
- Npm
- Usable with the latest Node.js LTS versions:
- Authentication: Auth0 for GitHub integration.
- GitHub email pulled during OAuth SignIN.
- Optional: Email validation.
- Roles: Admin, Users.
- ORM: Prisma for database management.
- User Profiles:
- ROLE: Default user.
- Fields: Name, surname, bio, country, address, job.
- API Features:
- Search, Pagination.
- Public Access: GET by ID, get all.
- Private access (requires token):
- Create, Update, Delete.
- Admin:
- Can search or mutate any user.
- Users:
- Can view and mutate only their own information.
@Todo
Edit Environment
Add a .env
file to your project root directory and populate as follows:
AUTH0_DOMAIN=YOUR_AUTH0_DOMAIN
AUTH0_CLIENT_ID=YOUR_AUTH0_CLIENT_ID
AUTH0_CLIENT_SECRET=YOUR_AUTH0_CLIENT_SECRET
JWT_SECRET=YOUR_JWT_SECRET
DATABASE_URL=YOUR_DATABASE_URL
Here's how to get the required Auth0 details. You need to register a client (application) in your Auth0 dashboard.
Follow these steps to register a client with Auth0:
- Open the Auth0 Applications section of the Auth0 Dashboard.
- Click on the Create Application button.
- Provide a Name, such as "GitHub Auth".
- Choose
Single Page Web Applications
as the application type. - Click on the Create button.
- Finally, note down your
Domain
,Client ID
, andClient Secret
and add them to your.env
file. Click the settings tab if you do not see them.
Choose a random string of letters and numbers for your JWT_SECRET
and populate the DATABASE_URL
with your database connection string.
Install Dependencies
Run the following to install dependencies:
npm install
OR
yarn
Set Up Prisma
- Run the following command to generate the Prisma client and apply migrations:
npx prisma generate
npx prisma migrate dev --name init
- If you need to seed your database, you can add a
seed
script in theprisma/seed.ts
file and run:
npx prisma db seed
Run Your Server
Start the Django server with:
npm run start:dev
OR
yarn start:dev
Compile React UI
Edit Environment
Add your server base URL to your environment variables as follows:
VITE_APP_PUBLIC_URL=<YOUR_SERVER_URL>
Install Dependencies
npm install
OR
yarn
Start the React UI
npm run dev
OR
yarn dev
Django API Starter provided by App Generator - Open-source service for developers and companies.