CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/components/landing/cocalc-com-features.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2023 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Button, Col, Grid, Row } from "antd";
7
import { join } from "path";
8
import { useEffect, useState } from "react";
9
import { SOFTWARE_ENVIRONMENT_ICON } from "@cocalc/frontend/project/settings/software-consts";
10
import { DOC_AI } from "@cocalc/util/consts/ui";
11
import { COLORS } from "@cocalc/util/theme";
12
import Path from "components/app/path";
13
import DemoCell from "components/demo-cell";
14
import { AvailableTools, Tool } from "components/landing/available-tools";
15
import Info from "components/landing/info";
16
import { CSS, Paragraph, Text } from "components/misc";
17
import A from "components/misc/A";
18
import ChatGPTHelp from "components/openai/chatgpt-help";
19
import {
20
Testimonial,
21
TestimonialComponent,
22
twoRandomTestimonials,
23
} from "components/testimonials";
24
import basePath from "lib/base-path";
25
import { useCustomize } from "lib/customize";
26
import assignments from "public/features/cocalc-course-assignments-2019.png";
27
import RTC from "public/features/cocalc-real-time-jupyter.png";
28
import ComputeServers from "./compute-servers";
29
import { LANDING_HEADER_LEVEL } from "./constants";
30
31
// NOTE: This component is only rendered if the onCoCalcCom customization variable is "true"
32
export function CoCalcComFeatures() {
33
const {
34
siteName = "CoCalc",
35
openaiEnabled,
36
sandboxProjectId,
37
jupyterApiEnabled,
38
shareServer = false,
39
onCoCalcCom,
40
} = useCustomize();
41
const width = Grid.useBreakpoint();
42
43
// to avoid next-js hydration errors
44
const [testimonials, setTestimonials] =
45
useState<[Testimonial, Testimonial]>();
46
47
useEffect(() => {
48
setTestimonials(twoRandomTestimonials());
49
}, []);
50
51
function renderCollaboration(): JSX.Element {
52
return (
53
<Info
54
level={LANDING_HEADER_LEVEL}
55
title="Realtime Collaboration Using Your Favorite Tools"
56
icon="users"
57
image={RTC}
58
anchor="a-realtimesync"
59
alt={"Two browser windows editing the same Jupyter notebook"}
60
style={{ backgroundColor: COLORS.ANTD_BG_BLUE_L }}
61
belowWide={true}
62
icons={[
63
{ icon: "jupyter", link: "/features/jupyter-notebook" },
64
{ icon: "tex", title: "LaTeX", link: "/features/latex-editor" },
65
{ icon: "slides", title: "Whiteboard", link: "/features/whiteboard" },
66
]}
67
>
68
<Paragraph>
69
With {siteName}, you can easily collaborate with colleagues, students,
70
and friends to edit computational documents. We support{" "}
71
<A href={"/features/jupyter-notebook"}>
72
<strong>Jupyter Notebooks</strong>
73
</A>
74
, <A href={"/features/latex-editor"}>LaTeX files</A>,{" "}
75
<A href="/features/sage">SageMath Worksheets</A>,{" "}
76
<A href={"/features/whiteboard"}>Computational Whiteboards</A>, and
77
much more. We have an{" "}
78
<A href={"https://doc.cocalc.com/why.html#open-world-approach"}>
79
open world approach
80
</A>{" "}
81
giving users as much flexibility in choosing software and hardware as
82
possible.
83
</Paragraph>
84
85
<Paragraph>
86
You and your collaborators use the same per-project environment, which
87
provides consistent results, synchronized file changes, and automatic
88
revision history so that you can go back in time when you need to
89
discover what changed and when. {renderShareServer()}
90
</Paragraph>
91
92
<Paragraph>
93
Forget the frustration of sending files back and forth between your
94
collaborators, wasting time reviewing changes, and merging documents.{" "}
95
<A href={"/auth/sign-up"}>Get started with {siteName} today.</A>
96
</Paragraph>
97
</Info>
98
);
99
}
100
101
function renderTeaching() {
102
return (
103
<Info
104
level={LANDING_HEADER_LEVEL}
105
title="Integrated Course Management System"
106
icon="graduation-cap"
107
image={assignments}
108
anchor="a-teaching"
109
alt={"Two browser windows editing the same Jupyter notebook"}
110
style={{ backgroundColor: COLORS.ANTD_BG_BLUE_L }}
111
icons={[
112
{
113
icon: "users",
114
title: "Course Management",
115
link: "https://doc.cocalc.com/teaching-instructors.html",
116
},
117
{
118
icon: "graduation-cap",
119
title: "NBGrader",
120
link: "https://doc.cocalc.com/teaching-nbgrader.html",
121
},
122
{ icon: "slides", title: "Slides", link: "/features/whiteboard" },
123
]}
124
>
125
<Paragraph>
126
You can think of {siteName} as{" "}
127
<Text strong>virtual computer lab</Text> in the cloud. It takes away
128
the pain of teaching scientific software.
129
</Paragraph>
130
<Paragraph>
131
<Text strong>Hassle-free assignments</Text>: {siteName} keeps all
132
files well organized! Due to real-time synchronization you never have
133
to deal with multiple versions of the same file. There is even support
134
for{" "}
135
<A href={"https://doc.cocalc.com/teaching-nbgrader.html"}>
136
automated grading via NBGrader
137
</A>
138
.
139
</Paragraph>
140
<Paragraph>
141
<Text strong>Pre-installed Software</Text> like in a computer lab,{" "}
142
<A href={"/software"}>all software you need</A> is already installed
143
and ready to use.
144
</Paragraph>
145
<Paragraph>
146
<Text strong>Real-time Collaboration</Text> allows you to virtually
147
look students over their shoulders. You can check their work directly
148
and help them by editing the file or using side-chat communication.
149
</Paragraph>
150
<Paragraph>
151
<Button
152
onClick={() =>
153
(window.location.href = join(basePath, "/features/teaching"))
154
}
155
>
156
More about teaching on {siteName}
157
</Button>
158
</Paragraph>
159
</Info>
160
);
161
}
162
163
function renderSandbox() {
164
if (!sandboxProjectId) return;
165
return (
166
<Info
167
level={LANDING_HEADER_LEVEL}
168
title={<>The Public {siteName} Sandbox</>}
169
icon="share-square"
170
anchor="a-sandbox"
171
style={{ backgroundColor: COLORS.GRAY_LLL }}
172
>
173
<Path
174
style={{ marginBottom: "15px" }}
175
project_id={sandboxProjectId}
176
description="Public Sandbox"
177
/>
178
</Info>
179
);
180
}
181
182
function renderShareServer() {
183
if (!shareServer) return;
184
185
return (
186
<>
187
{" "}
188
You can even publish your {siteName} creations to share with anyone via
189
the built-in <A href={"/share/public_paths/page/1"}>share server</A>.
190
</>
191
);
192
}
193
194
function renderMore(): JSX.Element {
195
const text = {
196
software: `All available software`,
197
whiteboard: `Computational whiteboard`,
198
features: `Features overview`,
199
};
200
const software = (
201
<Paragraph style={{ textAlign: "center" }}>
202
<Button
203
onClick={() => (window.location.href = join(basePath, "/software"))}
204
title={text.software}
205
>
206
{text.software}
207
</Button>
208
</Paragraph>
209
);
210
const whiteboard = (
211
<Paragraph style={{ textAlign: "center" }}>
212
<Button
213
onClick={() =>
214
(window.location.href = join(basePath, "/features/whiteboard"))
215
}
216
title={text.whiteboard}
217
>
218
{text.whiteboard}
219
</Button>
220
</Paragraph>
221
);
222
const features = (
223
<Paragraph style={{ textAlign: "center" }}>
224
<Button
225
onClick={() => (window.location.href = join(basePath, "/features"))}
226
title={text.features}
227
>
228
{text.features}
229
</Button>
230
</Paragraph>
231
);
232
return (
233
<Info
234
level={LANDING_HEADER_LEVEL}
235
title="Much More …"
236
icon="wrench"
237
anchor="more"
238
style={{ backgroundColor: COLORS.YELL_LLL }}
239
>
240
<Row>
241
<Col md={8}>
242
<Tool
243
icon={SOFTWARE_ENVIRONMENT_ICON}
244
href="/software"
245
title="Available Software"
246
alt="Available Software"
247
>
248
<Paragraph>
249
{siteName} comes with a variety of software pre-installed,
250
including
251
<A href={"/features/python"}>Python</A>,{" "}
252
<A href={"/features/sage"}>SageMath</A>,{" "}
253
<A href={"/features/r-statistical-software"}>R</A> and{" "}
254
<A href={"/features/julia"}>Julia</A> . You can{" "}
255
<A
256
href={"https://doc.cocalc.com/howto/install-python-lib.html"}
257
>
258
install additional software
259
</A>{" "}
260
directly in your project as well.
261
</Paragraph>
262
{!width.md && software}
263
</Tool>
264
</Col>
265
<Col md={8}>
266
<Tool
267
icon="layout"
268
href="/features/whiteboard"
269
title="Computational Whiteboard"
270
alt="Computational Whiteboard"
271
>
272
<Paragraph>
273
Use a full featured collaborative whiteboard – with support for
274
Jupyter notebook cells – to express and share your ideas.
275
</Paragraph>
276
{!width.md && whiteboard}
277
</Tool>
278
</Col>
279
<Col md={8}>
280
<Tool
281
icon="wrench"
282
href="/features"
283
alt="Features"
284
title="Feature Overview"
285
>
286
<Paragraph>
287
{siteName} offers a variety of features to make your life
288
easier. You can find a list of all features{" "}
289
<A href="/features">here</A>.
290
</Paragraph>
291
{!width.md && features}
292
</Tool>
293
</Col>
294
{width.md && (
295
<>
296
<Col md={8}>{software}</Col>
297
<Col md={8}>{whiteboard}</Col>
298
<Col md={8}>{features}</Col>
299
</>
300
)}
301
</Row>
302
</Info>
303
);
304
}
305
306
function renderAvailableProducts(): JSX.Element {
307
const txtCol = COLORS.GRAY_LL;
308
const toolCol = "white";
309
310
const link: CSS = {
311
color: "white",
312
fontWeight: "bold",
313
} as const;
314
315
const bottom: CSS = {
316
color: txtCol,
317
textAlign: "center",
318
fontSize: "150%",
319
} as const;
320
321
const urlProducts = "/pricing/products";
322
const urlCourses = "/pricing/courses";
323
const urlOnprem = "/pricing/onprem";
324
325
const productsLink = (
326
<Paragraph style={bottom}>
327
<Button
328
ghost
329
size="large"
330
style={{ fontWeight: "bold" }}
331
onClick={() => (window.location.href = join(basePath, urlProducts))}
332
title={"Products Overview"}
333
>
334
Products Overview
335
</Button>
336
</Paragraph>
337
);
338
339
const courseLink = (
340
<Paragraph style={bottom}>
341
<Button
342
ghost
343
size="large"
344
style={{ fontWeight: "bold" }}
345
onClick={() => (window.location.href = join(basePath, urlCourses))}
346
title={"Course Licenses"}
347
>
348
Course Licenses
349
</Button>
350
</Paragraph>
351
);
352
353
const onpremLink = (
354
<Paragraph style={bottom}>
355
<Button
356
ghost
357
size="large"
358
style={{ fontWeight: "bold" }}
359
onClick={() => (window.location.href = join(basePath, urlOnprem))}
360
title={"On-Premises Offerings"}
361
>
362
On-Premises Offerings
363
</Button>
364
</Paragraph>
365
);
366
367
return (
368
<Info
369
level={LANDING_HEADER_LEVEL}
370
title="Solutions"
371
icon="shopping-cart"
372
anchor="products"
373
style={{ backgroundColor: COLORS.BLUE_D }}
374
textStyle={{ color: COLORS.GRAY_LL }}
375
>
376
<Row>
377
<Col md={8}>
378
<Tool
379
icon="server"
380
href={urlProducts}
381
title="Online Service with GPUs"
382
alt="Online Service"
383
textStyle={{ color: toolCol }}
384
>
385
<Paragraph style={{ color: txtCol }}>
386
You can start using {siteName} online for free today.{" "}
387
<A href={"/auth/sign-up"} style={link}>
388
Create an account
389
</A>
390
, open your{" "}
391
<A style={link} href={"https://doc.cocalc.com/trial.html"}>
392
trial project
393
</A>{" "}
394
and{" "}
395
<A
396
style={link}
397
href={"https://doc.cocalc.com/getting-started.html"}
398
>
399
start exploring
400
</A>{" "}
401
{siteName}.
402
</Paragraph>
403
<Paragraph style={{ color: txtCol }}>
404
Upgrade your projects to unlock internet access, better hosting
405
quality, and other upgrades by purchasing a{" "}
406
<A style={link} href={"/store/site-license"}>
407
license
408
</A>{" "}
409
or upgrade via{" "}
410
<A style={link} href={"https://doc.cocalc.com/paygo.html"}>
411
pay-as-you-go
412
</A>{" "}
413
and use GPUs and HPC resources via{" "}
414
<A
415
style={link}
416
href={"https://doc.cocalc.com/compute_server.html"}
417
>
418
compute servers
419
</A>
420
!
421
</Paragraph>
422
{!width.md && productsLink}
423
</Tool>
424
</Col>
425
<Col md={8}>
426
<Tool
427
icon="graduation-cap"
428
href={urlCourses}
429
title="Teach a Course"
430
alt="Teach a Course"
431
textStyle={{ color: toolCol }}
432
>
433
<Paragraph style={{ color: txtCol }}>
434
You can{" "}
435
<A style={link} href="/features/teaching">
436
teach a course
437
</A>{" "}
438
on {siteName} online!
439
</Paragraph>
440
<Paragraph style={{ color: txtCol }}>
441
The{" "}
442
<A style={link} href="pricing/courses">
443
course license options
444
</A>{" "}
445
are very flexible: they range from small professional training
446
up to large university courses. The students can pay {siteName}{" "}
447
directly, or you can pay on their behalf, and it is easy to
448
change a license at any time if you need more resources or the
449
number of students changes.
450
</Paragraph>
451
{!width.md && courseLink}
452
</Tool>
453
</Col>
454
<Col md={8}>
455
<Tool
456
icon="network-wired"
457
href={urlOnprem}
458
alt="On-Premises"
459
title={"On-Premises"}
460
textStyle={{ color: toolCol }}
461
>
462
<Paragraph style={{ color: txtCol }}>
463
It is very easy to run {siteName} on your own computer or
464
cluster. The available options are:
465
<ol>
466
<li>
467
Make your computer available in a {siteName} project via an{" "}
468
<A
469
style={link}
470
href={"https://doc.cocalc.com/compute_server.html"}
471
>
472
on-prem compute server
473
</A>
474
.
475
</li>
476
<li>
477
Deploy a highly scalable variant of {siteName} on your{" "}
478
<strong>Kubernetes cluster</strong> via{" "}
479
<A style={link} href="https://onprem.cocalc.com/">
480
<strong>CoCalc OnPrem</strong>
481
</A>
482
.
483
</li>
484
</ol>
485
</Paragraph>
486
{!width.md && onpremLink}
487
</Tool>
488
</Col>
489
{width.md && (
490
<>
491
<Col md={8}>{productsLink}</Col>
492
<Col md={8}>{courseLink}</Col>
493
<Col md={8}>{onpremLink}</Col>
494
</>
495
)}
496
</Row>
497
</Info>
498
);
499
}
500
501
function renderTestimonials() {
502
if (!testimonials) return;
503
const [t1, t2] = testimonials;
504
return (
505
<Info
506
level={LANDING_HEADER_LEVEL}
507
title="Testimonials"
508
icon="comment"
509
anchor="testimonials"
510
style={{ backgroundColor: COLORS.BS_GREEN_LL }}
511
>
512
<Row gutter={[15, 15]}>
513
<Col md={12}>
514
<TestimonialComponent testimonial={t1} />
515
</Col>
516
<Col md={12}>
517
<TestimonialComponent testimonial={t2} />
518
</Col>
519
<Col md={24} style={{ textAlign: "center" }}>
520
<Button
521
onClick={() =>
522
(window.location.href = join(basePath, "/testimonials"))
523
}
524
title={`More testimonials from users of ${siteName}`}
525
>
526
More testimonials
527
</Button>
528
</Col>
529
</Row>
530
</Info>
531
);
532
}
533
534
function renderChatGPT() {
535
if (!openaiEnabled || !onCoCalcCom) return;
536
return (
537
<Info
538
level={LANDING_HEADER_LEVEL}
539
title="Extensive Generative AI Integration"
540
icon="robot"
541
imageComponent={<ChatGPTHelp size="large" tag={"index"} />}
542
anchor="a-realtimesync"
543
alt={"Two browser windows editing the same Jupyter notebook"}
544
style={{ backgroundColor: COLORS.ANTD_BG_BLUE_L }}
545
>
546
<Paragraph>
547
A wide range of{" "}
548
<A href={DOC_AI}>Generative AI Large Language Models</A> are highly
549
integrated into {siteName}. This helps you{" "}
550
<A href={`${DOC_AI}#jupyter-notebooks`}>fix errors</A>, generate code
551
or LaTeX snippets, summarize documents, and much more.
552
</Paragraph>
553
</Info>
554
);
555
}
556
557
function renderDemoCell() {
558
if (!jupyterApiEnabled) return;
559
560
return (
561
<Info
562
level={LANDING_HEADER_LEVEL}
563
title="Many Programming Languages"
564
icon="flow-chart"
565
imageComponent={<DemoCell tag={"sage"} style={{ width: "100%" }} />}
566
anchor="a-realtimesync"
567
alt={"Two browser windows editing the same Jupyter notebook"}
568
style={{ backgroundColor: COLORS.YELL_LLL }}
569
icons={[
570
{ icon: "julia", link: "/features/julia" },
571
{ icon: "linux", link: "/features/linux" },
572
{ icon: "python", link: "/features/python" },
573
{ icon: "r", link: "/features/r-statistical-software" },
574
{ icon: "sagemath", title: "SageMath", link: "/features/sage" },
575
{ icon: "octave", link: "/features/octave" },
576
]}
577
>
578
<Paragraph>
579
{siteName} supports many{" "}
580
<A href={"/software"}>programming languages</A>. Edit the demo cell on
581
the left and evaluate it by pressing "Run". You can also select a
582
different "kernel", i.e. the programming language that is used to
583
evaluate the cell.
584
</Paragraph>
585
</Info>
586
);
587
}
588
589
return (
590
<>
591
<ComputeServers />
592
{renderChatGPT()}
593
{renderDemoCell()}
594
{renderSandbox()}
595
{renderCollaboration()}
596
<AvailableTools style={{ backgroundColor: COLORS.YELL_LLL }} />
597
{renderTeaching()}
598
{renderMore()}
599
{renderTestimonials()}
600
{renderAvailableProducts()}
601
</>
602
);
603
}
604
605