Skip to content

ojengwa/djangoNext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project README

Overview

This project is a full-stack web application that consists of a Next.js frontend and a Django backend. The frontend provides a user interface for interacting with the backend, which offers various APIs and handles business logic. Docker and Docker Compose are used to manage the development environment, ensuring that both services run consistently across different environments.

Project Structure

project-root/
│
├── backend/
│   ├── Dockerfile
│   ├── backend/  # Your Django project
│   ├── manage.py
│   └── ...  # Other backend files and directories
│
├── frontend/
│   ├── Dockerfile
│   ├── next.config.js
│   ├── src/
│   ├── public/
│   ├── package.json
│   └── ...  # Other frontend files and directories
│
├── compose.yml
└── README.md

Prerequisites

Getting Started

Clone the Repository

git clone <repository-url>
cd project-root

Environment Variables

Create a .env file in the root directory of the project and define the necessary environment variables for both frontend and backend.

Example for Django backend:

DJANGO_SECRET_KEY=your_secret_key
DATABASE_URL=postgres://user:password@db:5432/dbname

Example for Next.js frontend:

NEXT_PUBLIC_API_URL=http://localhost:8000

Build and Run the Containers

To build and run the containers for both frontend and backend, execute the following command:

docker-compose -f compose.yaml up --build

This command will:

  • Build the Docker images for both the frontend and backend.
  • Start the containers and set up the necessary services.

Access the Application

Development

Frontend Development

To start the Next.js development server with hot-reloading:

cd frontend
npm install
npm run dev

Backend Development

To start the Django development server:

cd backend
pip install -r requirements/local.txt
python manage.py runserver

Running Tests

Frontend Tests

To run the frontend tests:

cd frontend
npm test

Backend Tests

To run the backend tests:

cd backend
python manage.py test

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -m 'Add some feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Open a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors