Skip to content

Commit

Permalink
Merge pull request #11 from codersforcauses/chore/template_sync_90b5c17
Browse files Browse the repository at this point in the history
Update readmes
  • Loading branch information
yunho7687 authored Jun 24, 2024
2 parents 6eee9a1 + b88f572 commit ad91626
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 29 deletions.
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,30 @@ Django + Nextjs Template: Standardised CFC Tech Stack
0. Activate the dev container in VSCode
1. Create a copy of `.env.example` found in the `client` folder and name it `.env`
2. Create a copy of `.env.example` found in the `server` folder and name it `.env`
3. `docker compose up -d`
3. Start the database in the background with `docker compose up -d`
4. `cd server` then run `poetry install`
5. Run `python manage.py migrate` to apply migrations to the database
6. Start the backend with `python manage.py runserver`, you'll get a popup in VSCode telling you to open it in a browser (might be `localhost:8001`)
6. Start the backend with `python manage.py runserver`, you'll also get a popup in VSCode telling you to open it in a browser
7. In a new terminal, `cd client`
8. Install deps, `npm install`
9. Run the frontend `npm run dev`
10. Click the popup that shows in the bottom right of VSCode to open it in a browser (might be `localhost:3001`)
10. Click the popup that shows in the bottom right of VSCode to open it in a browser

## Server

### Create superuser

To log in to the Django admin dashboard, you'll need to create a superuser with the following command:

```bash
python manage.py createsuperuser
```

### Create and run migrations

If the models are updated, be sure to create a migration:

```bash
python manage.py makemigrations # create a new migration
python manage.py migrate # apply migrations
```
30 changes: 9 additions & 21 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,28 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# Frontend server

This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). It includes a number of other libraries:

- Tailwind for styling
- Tanstack Query for state management and data fetching
- Axios for data fetching
- shadcn/ui for components
- lucide for icons

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
4 changes: 0 additions & 4 deletions server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,4 @@ POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_PORT=5432

DJANGO_SUPERUSER_PASSWORD=Password123
DJANGO_SUPERUSER_EMAIL=[email protected]
DJANGO_SUPERUSER_USERNAME=admin

FRONTEND_URL="http://localhost:3000"
3 changes: 2 additions & 1 deletion server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
A template Django server.

1. Install dependencies: `poetry install`
2. Run: `poetry run python manage.py runserver` or `.\dev.sh`
2. Activate the virtual environment with `poetry shell` if needed
3. Run: `python manage.py runserver` or `.\dev.sh`

Note this file needs to be here otherwise poetry won't recognise this as a valid project.

0 comments on commit ad91626

Please sign in to comment.