-
Notifications
You must be signed in to change notification settings - Fork 0
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
46 changed files
with
9,894 additions
and
307 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 |
---|---|---|
@@ -1,15 +1,20 @@ | ||
UI Design | ||
<h1 align="center"> | ||
NeoMovie | ||
</h1> | ||
|
||
🔵Home Page | ||
# Description | ||
|
||
![MovieAppImage](https://user-images.githubusercontent.com/66914300/149370624-ca1a7814-44be-4937-86d4-5a810d0f6f93.PNG) | ||
> Developping MyAllociné projet | ||
🔵Search Result with modal | ||
# Techonologies used | ||
|
||
![MovieAppImage2](https://user-images.githubusercontent.com/66914300/149370693-3adbc3e0-a108-46c9-a8dc-85660f04821f.PNG) | ||
![React](https://img.shields.io/badge/-ReactJs-61DAFB?logo=react&logoColor=white&style=for-the-badge) | ||
![TailwindCSS](https://img.shields.io/badge/Tailwind_CSS-38B2AC?style=for-the-badge&logo=tailwind-css&logoColor=white) | ||
|
||
📌API_URL="https://api.themoviedb.org/3/movie/popular?api_key=55bb5aeea2538b26cf848582959d4fc8" | ||
![Node.js](https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white) | ||
|
||
📌API_IMG="https://image.tmdb.org/t/p/w500/" | ||
![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white) | ||
|
||
📌API_SEARCH="https://api.themoviedb.org/3/search/movie?api_key=55bb5aeea2538b26cf848582959d4fc8&query" | ||
## Authors | ||
|
||
- [Wassini Bouzidi](https://github.com/wassb92) - wassini.bouzidi@epitech.eu |
File renamed without changes.
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 @@ | ||
UI Design | ||
|
||
🔵Home Page | ||
|
||
![MovieAppImage](https://user-images.githubusercontent.com/66914300/149370624-ca1a7814-44be-4937-86d4-5a810d0f6f93.PNG) | ||
|
||
🔵Search Result with modal | ||
|
||
![MovieAppImage2](https://user-images.githubusercontent.com/66914300/149370693-3adbc3e0-a108-46c9-a8dc-85660f04821f.PNG) | ||
|
||
📌API_URL="https://api.themoviedb.org/3/movie/popular?api_key=55bb5aeea2538b26cf848582959d4fc8" | ||
|
||
📌API_IMG="https://image.tmdb.org/t/p/w500/" | ||
|
||
📌API_SEARCH="https://api.themoviedb.org/3/search/movie?api_key=55bb5aeea2538b26cf848582959d4fc8&query" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,49 @@ | ||
import React from "react"; | ||
import { Routes, Route, Outlet } from "react-router-dom"; | ||
|
||
/* components */ | ||
import Header from "./components/Header"; | ||
|
||
/* pages */ | ||
import Home from "./pages/Home"; | ||
import NotFound from "./pages/NotFound"; | ||
/* private */ | ||
import ProtectedRoutes from "./pages/private/ProtectedRoutes"; | ||
import Popular from "./pages/private/Popular"; | ||
|
||
const Layout = () => { | ||
return ( | ||
<> | ||
<Header /> | ||
<Outlet /> | ||
</> | ||
); | ||
}; | ||
|
||
const App = () => { | ||
return ( | ||
<Routes> | ||
<Route element={<ProtectedRoutes />}> | ||
<Route | ||
path="account/*" | ||
element={ | ||
<Routes> | ||
<Route element={<Layout />}> | ||
<Route path="/profile" element={<div>Profile page</div>} /> | ||
<Route path="/movies" element={<Popular />} /> | ||
</Route> | ||
<Route path="*" element={<NotFound />} /> | ||
</Routes> | ||
} | ||
/> | ||
</Route> | ||
<Route path="/" element={<Home />} /> | ||
{/* <Route element={<Layout />}> */} | ||
{/* <Route path="/login" element={<Login />} /> */} | ||
{/* </Route> */} | ||
<Route path="*" element={<NotFound />} /> | ||
</Routes> | ||
); | ||
}; | ||
|
||
export default App; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
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,31 @@ | ||
import React from "react"; | ||
import { Link } from "react-router-dom"; | ||
|
||
const NotFound = () => { | ||
return ( | ||
<div className="flex items-center justify-center w-full h-screen bg-gradient-to-r from-main to-secondary"> | ||
<div className="px-10 py-6 bg-white rounded-md shadow-xl"> | ||
<div className="flex flex-col items-center"> | ||
<div className="font-bold text-main text-6xl">Erreur 404</div> | ||
<br /> | ||
<div className="mb-2 text-2xl font-bold text-center text-gray-800 md:text-3xl"> | ||
Page introuvable | ||
</div> | ||
<div className="mb-8 text-center text-gray-500 md:text-lg"> | ||
La page que vous cherchez n'existe pas | ||
</div> | ||
<div className="my-6"> | ||
<Link | ||
to="/" | ||
className="mx-4 px-6 py-2 text-xl font-semibold text-white hover:bg-secondary bg-main rounded-xl" | ||
> | ||
Accueil | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default NotFound; |
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
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
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,9 @@ | ||
# Port using | ||
PORT=8080 | ||
|
||
# MongoDB collection | ||
MONGO_URI=mongodb+srv://root:8m8V3FHEfQWZcsPc@episolidairecluster.lsel2.mongodb.net/MyAllocineDB?retryWrites=true&w=majority | ||
|
||
# JWT | ||
JWT_SECRET=071d67264ccc6d7b0332867ccbf71c0c385b4a47e3d282170403c9142796500eb1ab44 | ||
JWT_EXPIRE=5m |
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,17 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
config.env | ||
testfile/ | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# MyAllocine Projet | ||
|
||
## Installation | ||
|
||
From root server folder | ||
|
||
```bash | ||
npm install -f | ||
``` | ||
|
||
## Lauching | ||
|
||
From root server folder | ||
|
||
```bash | ||
npm run start | ||
``` | ||
|
||
> **_NOTE:_** .env file with secret variables is not shared, please use your own. | ||
## Documentation | ||
|
||
Generate API's documentation | ||
|
||
```bash | ||
npm run swagger-autogen | ||
``` | ||
|
||
### Then go to http://localhost:8080/doc/ | ||
|
||
## Testing | ||
|
||
Run automated tests | ||
|
||
```bash | ||
npm run tests | ||
``` | ||
|
||
## Technologies | ||
|
||
- JavaScript | ||
- Node.js | ||
- Express | ||
- MongoDB | ||
- Swagger |
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 @@ | ||
require("dotenv").config({ path: "./.env" }); | ||
const express = require("express"); | ||
const cors = require("cors"); | ||
const errorHandler = require("./middleware/error"); | ||
const connectDB = require("./config/db"); | ||
const app = express(); | ||
const swaggerUi = require("swagger-ui-express"); | ||
const swaggerFile = require("./swagger/output.json"); | ||
const bodyParser = require("body-parser"); | ||
|
||
connectDB(); | ||
app.use(cors({ origin: true })); | ||
app.use(express.json()); | ||
app.use(express.urlencoded({ extended: true })); | ||
|
||
// login and register with JWT (no api) | ||
app.use("/api", require("./routes/auth")); | ||
app.use("/api", require("./routes/private")); | ||
|
||
app.use("/doc", swaggerUi.serve, swaggerUi.setup(swaggerFile)); | ||
|
||
app.use(errorHandler); | ||
|
||
module.exports = app; |
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,20 @@ | ||
const mongoose = require("mongoose"); | ||
require("dotenv"); | ||
|
||
const connectDB = async () => { | ||
try { | ||
if (!process.env.MONGO_URI) { | ||
throw new Error("MONGO_URI must be set"); | ||
} | ||
await mongoose.connect(process.env.MONGO_URI, { | ||
useNewUrlParser: true, | ||
useUnifiedTopology: true, | ||
}); | ||
console.log("MongoDB connected"); | ||
} catch (err) { | ||
console.error(err.message); | ||
process.exit(84); | ||
} | ||
}; | ||
|
||
module.exports = connectDB; |
Oops, something went wrong.