-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
223 changed files
with
40,993 additions
and
14,142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ node_modules | |
.git | ||
.gitignore | ||
.env.example | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,7 @@ BOT_TOKEN = "123" | |
GUILD_ID = "123" | ||
LOCAL_CMS_PROVIDER = true | ||
CACHE_EXPIRE_S = 10 | ||
|
||
ADMINS = "Random,[email protected]" | ||
NEXT_PUBLIC_DISABLE_FEATURES = "featurea,featureb,featurec" | ||
REDIS_URL= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/cms?schema=public" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,5 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
*storybook.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { StorybookConfig } from '@storybook/nextjs'; | ||
|
||
const config: StorybookConfig = { | ||
stories: [ | ||
'../storybook/**/*.mdx', | ||
'../storybook/**/*.stories.@(js|jsx|mjs|ts|tsx)', | ||
'../storybook/stories/components/**/*.stories.@(js|jsx|mjs|ts|tsx)', | ||
], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@chromatic-com/storybook', | ||
'@storybook/addon-interactions', | ||
], | ||
framework: { | ||
name: '@storybook/nextjs', | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: 'tag', | ||
}, | ||
staticDirs: ['../public'], | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Preview } from '@storybook/react'; | ||
import '../src/styles/tailwind.css'; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM node:20-alpine | ||
ARG DATABASE_URL | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY . . | ||
|
||
RUN npm install | ||
RUN DATABASE_URL=$DATABASE_URL npx prisma generate | ||
RUN DATABASE_URL=$DATABASE_URL npm run build | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["npm", "run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,96 @@ | ||
<h1 align='center'>CMS</h1> | ||
|
||
## Setup Procedure | ||
## Table of contents | ||
|
||
* Docker | ||
|
||
OR | ||
1. Clone the repository: | ||
```bash | ||
git clone https://github.com/code100x/cms.git | ||
``` | ||
2. Navigate to the project directory: | ||
```bash | ||
cd cms | ||
``` | ||
3. Run the following command to start the application: | ||
```bash | ||
docker create volume postgres-data # (optional) run this command if you face any mount volume / volume not exist error | ||
docker-compose up | ||
``` | ||
|
||
* Copy .env.example to .env | ||
* Get a postgres db from https://neon.tech/ (or any other provider) | ||
* Replace the DATABASE_URL in .env | ||
* Run ```npx prisma migrate dev``` to setup schema | ||
## Steps to run locally | ||
With Docker | ||
### Without Docker | ||
|
||
* ```docker compose up``` | ||
1. clone the repository: | ||
```bash | ||
git clone https://github.com/code100x/cms.git | ||
``` | ||
2. Navigate to the project directory: | ||
```bash | ||
cd cms | ||
``` | ||
3. (optional) Start a PostgreSQL database using Docker: | ||
```bash | ||
docker run -d \ | ||
--name cms-db \ | ||
-e POSTGRES_USER=myuser \ | ||
-e POSTGRES_PASSWORD=mypassword \ | ||
-e POSTGRES_DB=mydatabase \ | ||
-p 5432:5432 \ | ||
postgres | ||
``` | ||
based on this command the connection url will be | ||
``` | ||
DATABASE_URL=postgresql://myuser:mypassword@localhost:5432/mydatabase?schema=public | ||
``` | ||
4. Create a `.env` file based on the `.env.example` file and configure the `DATABASE_URL` with your postgreSQL connection string. | ||
5. Install dependencies: | ||
```bash | ||
npm install | ||
``` | ||
6. Run database migrations: | ||
```bash | ||
npm run prisma:migrate | ||
``` | ||
7. Seed the database: | ||
```bash | ||
npm run db:seed | ||
``` | ||
8. Start the development server: | ||
```bash | ||
npm run dev | ||
``` | ||
|
||
Without Docker | ||
* ```npm install``` | ||
* ```npm run db:seed``` to seed the database | ||
* ```npm run dev``` | ||
* Login using any userid and password 123456 | ||
* You should be able to see some test courses | ||
## Usage | ||
|
||
Make sure to lint and format your code before creating a PR | ||
* ```npm run lint:check``` to check for lint errors | ||
* ```npm run lint:fix``` to fix lint errors | ||
* ```npm run format:check``` to format the code | ||
* ```npm run format:fix``` to fix the formatting | ||
* If the code is not formatted properly, the CI will fail | ||
1. Access the aplication in your browser at `http://localhost:3000` | ||
2. Login using any provided user credentials | ||
- (email: `[email protected]`, password: `123456`) | ||
- (email: `[email protected]`, password: `123456`) | ||
|
||
--- | ||
## Contributing | ||
|
||
Read [contributing guidelines](./CONTRIBUTING.md) to start making contributions | ||
We welcome contributions from the community! To contribute to CMS, follow these steps: | ||
|
||
1. Fork the repository. | ||
2. Create a new branch (`git checkout -b feature/fooBar`). | ||
3. Make your changes and commit them (`git commit -am 'Add some fooBar'`). | ||
> Make sure to lint and format your code before commiting | ||
> | ||
> - `npm run lint:check` to check for lint errors | ||
> - `npm run lint:fix` to fix lint errors | ||
> - `npm run format:check` to format the code | ||
> - `npm run format:fix` to fix the formatting | ||
4. Push to the branch (`git push origin feature/fooBar`). | ||
5. Create a new Pull Request. | ||
|
||
For major changes, please open an issue first to discuss what you would like to change. | ||
|
||
Read our [contribution guidelines](./CONTRIBUTING.md) for more details. | ||
|
||
## Contributors | ||
|
||
<a href="https://github.com/code100x/cms/graphs/contributors"> | ||
<img src="https://contrib.rocks/image?repo=code100x/cms&max=400&columns=20" /> | ||
</a> | ||
|
||
## Issues on mac Silicon | ||
brew install pkg-config cairo pango libpng jpeg giflib librsvg |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"projectId": "Project:66234a5ec2e12ce0e1adf381", | ||
"zip": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
experimental: { | ||
serverActions: { | ||
allowedOrigins: ['localhost:3000', 'app.100xdevs.com', 'app2.100xdevs.com'] | ||
} | ||
} | ||
}, | ||
swcMinify: true, | ||
webpack: (config) => { | ||
// Enable polling based on env variable being set | ||
if (process.env.NEXT_WEBPACK_USEPOLLING) { | ||
config.watchOptions = { | ||
poll: 500, | ||
aggregateTimeout: 300 | ||
}; | ||
} | ||
return config; | ||
}, | ||
}; | ||
|
||
module.exports = nextConfig; |
Oops, something went wrong.